home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / dsp / dr.bub / 96000.lha / 96000 / appb / b139.asm < prev    next >
Assembly Source File  |  1992-04-28  |  1KB  |  35 lines

  1. ; This program was originally published in the Motorola DSP96002 Users Manual
  2. ; and is provided under a DISCLAIMER OF WARRANTY available from Motorola DSP
  3. ; Operation, 6501 William Cannon Drive West, Austin, Texas 78735-8598.  For
  4. ; more information, refer to the DSP96002 Users Manual, Appendix B, DSP
  5. ; Benchmarks.
  6. ;
  7. ; B.1.39    Nth Order Polynomial Evaluation for Two Points 
  8.  
  9. ;An Nth order polynomial c1XN + c2XN-1 + ...cNX + cN+1 can be factored 
  10. ;and represented as ((c1X + c2)X + c3)X + ...) + cN+1. This routine 
  11. ;evaluates the polynomial at both X = s and X = t. 
  12. ;Memory Map :   X             Y 
  13. ;       r1 ->   s             t 
  14. ;               . 
  15. ;               . 
  16. ;       r0 ->   c1 
  17. ;               c2 
  18. ;               c3 
  19. ;               . 
  20. ;               . 
  21. ;               cN+1 
  22. ;  Setup N equ  order of polynomial 
  23. move #coef,r0 
  24. move #2_pts,r1 
  25. move x:(r1)+,d5.s y:,d4.s                     ; s, t 
  26. move x:(r0)+,d1.s                             ; c1 
  27. move d1.s,d0.s 
  28. ; Inner loop for evaluating 2 consecutive points 
  29. do #N,_loop 
  30. fmpy.x d1,d5,d1  x:(r0)+,d2.s                 ; c(n)*s, c(n+1) 
  31. fmpy   d0,d4,d0  fadd.x d2,d1                 ; c(n)*t, c(n)*s+c(n+1) 
  32. fadd.x d2,d0                                  ; c(n)*t+c(n+1) _loop 
  33.